//
//  DLPhotoCameraUtil.h
//  DGGPhotoCameraSDK
//
//  Created by 伍明鹏 on 2019/12/31.
//

#import <Foundation/Foundation.h>
#import <Photos/Photos.h>
#import "DLPhotoBrowser.h"

NS_ASSUME_NONNULL_BEGIN

//拍照
typedef void(^TakePhotoBlock)(UIImage *image, NSURL *videoUrl);
//选择照片
typedef void(^ChoosePhotoBlock)(NSArray<UIImage *> * _Nonnull images, NSArray<PHAsset *> * _Nonnull assets, BOOL isOriginal);
//选择照片出错
typedef void(^ChoosePhotoErrorBlock)(NSArray<PHAsset *> * _Nonnull errorAssets, NSArray<NSNumber *> * _Nonnull errorIndex);

@class DLPhotoBrowser;
@interface DLPhotoCameraUtil : NSObject

@property (nonatomic, strong) DLPhotoActionSheet *actionSheet;

//相册选择页面导航栏、底部工具栏的文字颜色
@property (nonatomic,strong) UIColor *tintColor;
//相册选择页面导航栏颜色
@property (nonatomic,strong) UIColor *navBarColor;
//底部工具栏确定按钮可选可交互时的颜色
@property (nonatomic,strong) UIColor *bottomBtnsNormalBgColor;
//底部工具栏确定按钮不可选时的颜色
@property (nonatomic,strong) UIColor *bottomBtnsDisableBgColor;
//底部工具栏确定按钮可选可交互时标题的颜色
@property (nonatomic,strong) UIColor *bottomBtnsNormalTitleColor;

@property (nonatomic,strong) UIColor *bottomBtnsNormalDoneTitleColor;

//选择图片右上角颜色
@property (nonatomic,strong) UIColor *indexLabelBgColor;
//长按拍照按钮进行录像时的颜色
@property (nonatomic,strong) UIColor *cameraProgressColor;
//照片最大选择数
@property (nonatomic,assign) NSInteger maxSelectCount;
// 是否允许选择视频 默认YES
@property (nonatomic, assign) BOOL allowSelectVideo;
// 是否允许选择图片 默认YES
@property (nonatomic, assign) BOOL allowSelectImage;
// 是否允许编辑视频，选择一张时候才允许编辑，默认NO
@property (nonatomic, assign) BOOL allowEditVideo;
//使用系统相机，默认NO
@property (nonatomic, assign) BOOL useSystemCamera;
//混合选择时 视频最小数量，默认为0
@property (nonatomic, assign) NSInteger minVideoSelectCountInMix;
//是否允许编辑图片，选择一张时候才允许编辑，默认YES
@property (nonatomic, assign) BOOL allowEditImage;
// 混合选择时 视频最大数量，默认等同最大选择数
@property (nonatomic, assign) NSInteger maxVideoSelectCountInMix;
// 是否允许录制视频，默认YES
@property (nonatomic, assign) BOOL allowRecordVideo;
// 是否显示选装图片的index
@property (nonatomic, assign) BOOL showSelectedIndex;

/**
 回调时候是否允许框架解析图片，默认YES
 
 @discussion 如果选择了大量图片，框架一下解析大量图片会耗费一些内存，开发者此时可置为NO，拿到assets数组后使用 DLPhotoManager 中提供的 "anialysisAssets:original:completion:" 方法进行逐个解析，以达到缓解内存瞬间暴涨的效果，该值为NO时，回调的图片数组为nil
 */
@property (nonatomic, assign) BOOL shouldAnialysisAsset;

@property (nonatomic, assign) BOOL saveNewImageAfterEdit;

//是否允许相册内部拍照
@property (nonatomic, assign) BOOL allowTakePhotoInLibrary;

@property (nonatomic, assign) BOOL allowTakePhoto;

@property (nonatomic, assign) NSInteger maxRecordDuration;

//展示相册
- (void)showPhotoAlbumWithCurrentController:(UIViewController *)currentController
                           preview:(BOOL)preview
                           choosePhotoBlock:(ChoosePhotoBlock)choosePhotoBlock
    choosePhotoErrorBlock:(ChoosePhotoErrorBlock)choosePhotoErrorBlock;

//展示相机
- (void)showCameraWithCurrentController:(UIViewController *)currentController takePhotoBlock:(TakePhotoBlock)takePhotoBlock;
@end
NS_ASSUME_NONNULL_END

